package com.yoomiito.app.interf;

import android.content.Context;
import android.text.SpannableString;
import android.view.LayoutInflater;
import android.widget.LinearLayout;

import com.yoomiito.app.model.bean.AppInterfaceInfo;
import com.yoomiito.app.model.bean.GoodsDetail;
import com.yoomiito.app.model.my.MyRemainMoneyInfo;

public abstract class BaseOrderGoodsView extends LinearLayout {

    public Context mContext;
    public GoodsDetail mGoodsDetail;
    public OnShowInfoListener mOnShowInfoListener;
    public SpannableString spanText;
    public String mGoodsTotalPrice;//总价
    public  AppInterfaceInfo appInterfaceInfo;

    public BaseOrderGoodsView(Context context, GoodsDetail mGoodsDetail, AppInterfaceInfo appInterfaceInfo) {
        super(context);
        this.mContext = context;
        this.mGoodsDetail = mGoodsDetail;
        this.appInterfaceInfo = appInterfaceInfo;
        LayoutInflater.from(context).inflate(getView(),this,true);
        initView();
    }

    public abstract int getView();

    public abstract void initView();

    //设置余额及优米信息
    public void setMoneyInfo(MyRemainMoneyInfo moneyInfo) {
    }

    public interface OnShowInfoListener{
        void onShow(SpannableString spanText,int goodsSize,int yoMoneyPay);
    }

    public void addOnShowInfoListener(OnShowInfoListener onShowInfoListener){
        this.mOnShowInfoListener = onShowInfoListener;
    }

    public SpannableString getSpanText() {
        return spanText;
    }
}
